This invention relates to a memory device with a comparison function, and more particularly to a hardware element for comparing the magnitude of binary numbers at a high speed and which can be used for, for example, high-speed-sorting processing among various data processings.
Sorting is a processing in which a plurality of data are sorted or arranged in order of magnitude. This processing has been carried out by use of software techniques. That is, (1) two pieces of data are compared to determine which is greater; (2) based upon the result of the comparison, the pieces of data are sorted in order of magnitude. Several kinds of algorithms are proposed for such a purpose.
However, in any algorithms, when the number of pieces of data becomes large, a very long time is required for processing such data. Therefore, it actually becomes impossible to frequently conduct the sorting. Therefore, when high-speed-sorting is required, exclusive-use-hardware, i.e., a "Sort Engine" is designed to realize the algorithm [see, Nikkei Electronics, Sept. 23, 1985 (No. 378), p. 234.about.280)].
However, even in such a Sort Engine, there are several disadvantages, such as the number of pieces of data to be processed is restricted; even when one piece of data is added through sorting to data block (total number N) which were sorted, (N+1).multidot..DELTA.T time is required (.DELTA.T: cycle time when sorting is carried out in a pipe line manner). Therefore, the usage of a Sort Engine is minimal.